ifeq ($(LOCAL), 1)
SDCC=/usr/bin/sdcc
SDCC_SHARES=/usr/share/sdcc
else
SDCC=sdcc-sdcc
SDCC_SHARES=/usr/share/sdcc
endif

skywatcher.hex: skywatcher.o usart.o
	$(SDCC) -mpic16 -p18f4431 -V --debug -Wl-c -Wl-m --use-non-free -I. -o skywatcher.hex skywatcher.o usart.o

skywatcher.o: skywatcher.c skywatcher.h 
	$(SDCC) -mpic16 -p18f4431 -V --debug  --use-non-free -I. -c skywatcher.c 
usart.o: usart.c usart.h 
	$(SDCC) -mpic16 -p18f4431 -V --debug --use-non-free -I. -c usart.c 
clean:
	rm *.cod *.cof *.hex *.o
